package core.schedule.snake.data.mydao;

import java.io.Serializable;

public class PagingBean implements Serializable {

	private static final long serialVersionUID = -1431872118906571066L;
	
	private int showRecordsOfPage = 20;
	
	private int allPage = 1;
	
	private int allRecords = 0;
	
	private int currentPage = 1;
	
	private int beginRecord;

	private int endRecord;

	

	public void setAllRecords(int allRecords) {
		this.allRecords = allRecords;
		this.allPage = (int)Math.ceil((double)this.allRecords / this.showRecordsOfPage);
	}

	public int getBeginRecord() {
		return (currentPage-1)*showRecordsOfPage+1;
	}


	public int getEndRecord() {
		return getBeginRecord()+showRecordsOfPage-1;
	}

	public int getShowRecordsOfPage() {
		return showRecordsOfPage;
	}

	public void setShowRecordsOfPage(int showRecordsOfPage) {
		this.showRecordsOfPage = showRecordsOfPage;
	}

	public int getAllPage() {
		return allPage;
	}

	public void setAllPage(int allPage) {
		this.allPage = allPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getAllRecords() {
		return allRecords;
	}

	public void setBeginRecord(int beginRecord) {
		this.beginRecord = beginRecord;
	}

	public void setEndRecord(int endRecord) {
		this.endRecord = endRecord;
	}

	
}
